<?php

class weapon extends item
{

    public function __construct($_name, $_descript)
    {
        parent::__construct($_name, $_descript);
    }

    const 
    TYPE_AXE=1,
    TYPE_SWORD=2,
    TYPE_PIKE=3,
    TYPE_BOW=4,
    TYPE_STICK=5,
    TYPE_DAGGER=6;
    const
    ELEM_STAB=1,
    ELEM_CUT=2,
    ELEM_BROW=3;
            
    
    private $power,$type;
    private $crt_revice,$hit_revice,$spd_revice;
    private $elem_fire,$elem_ice,$elem_thunder;


    private static $HIT_RATIO = array(
        weapon::TYPE_AXE => 0.5,
        weapon::TYPE_SWORD => 0.7,
        weapon::TYPE_PIKE => 0.75,
        weapon::TYPE_BOW => 0.65,
        weapon::TYPE_STICK => 0.80,
        weapon::TYPE_DAGGER => 0.90
    );
    private static $CRT_RATIO = array(
        weapon::TYPE_AXE => 0.20,
        weapon::TYPE_SWORD => 0.07,
        weapon::TYPE_PIKE => 0.05,
        weapon::TYPE_BOW => 0.06,
        weapon::TYPE_STICK => 0.02,
        weapon::TYPE_DAGGER => 0.04
    );
    private static $SPD_RATIO = array(
        weapon::TYPE_AXE => 0.10,
        weapon::TYPE_SWORD => 0.70,
        weapon::TYPE_PIKE => 0.60,
        weapon::TYPE_BOW => 0.80,
        weapon::TYPE_STICK => 0.50,
        weapon::TYPE_DAGGER => 1.30
    );
 
    public function getPower(){
        return $this->power;
    }
    public function getType(){
        return $this->type;
    }
    public function getCRT(){
        return $this->crt_revice+weapon::$CRT_RATIO[$this->type];
    }
    public function getSPD(){
        return $this->spd_revice+weapon::$SPD_RATIO[$this->type];
    }
    public function getHIT(){
        return $this->hit_revice+weapon::$HIT_RATIO[$this->type];
    }
    
    
    
    
    

}